package com.example.entity;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @Author: wyp
 * @Date: 2021/8/30 23:50
 */
public class BeanLifeCycleDemoBean {

    public BeanLifeCycleDemoBean() {
        System.out.println("1.调用无参构造创建对象！！！");
    }

    private String name;

    public void setName(String name) {
        this.name = name;
        System.out.println("2.调用set方法注入属性："+name);
    }

    public void initMethod(){
        System.out.println("4.进入initMethod方法！！！");
    }

    public void destroyMethod(){
        System.out.println("7.进入destroyMethod方法！！！");
    }

    public void doMethod(){
        System.out.println("6.正常执行Bean的方法！！！");
    }
}
